package com.zgjkhis.modules.basicsetting.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author yzq
 * @Description 其他收费
 * @Date 2021/6/23 9:38
 * @Param
 * @return
 **/
@Data
@TableName("his_other_charge")
public class OtherCharge implements Serializable {

    @TableId
    private Long id;
    @ApiModelProperty(value = "项目类型1：检验，2：检查，3：其他")
    private Integer type;
    @ApiModelProperty(value = "收费项目名称")
    private String projectName;
    @ApiModelProperty(value = "拼英码")
    private String py;
    @ApiModelProperty(value = "英语名称")
    private String englishName;
    @ApiModelProperty(value = "单位")
    private String company;
    @ApiModelProperty(value = "零售价")
    private BigDecimal salePrice;
    @ApiModelProperty(value = "成本价")
    private BigDecimal costPrice;
    @ApiModelProperty(value = "业务说明")
    private String businessDescription;
    @ApiModelProperty(value = "国际编码")
    private String internationalCode;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "允许折扣0：否，1：是")
    private Integer isDiscount;
    @ApiModelProperty(value = "0：有效，1：无效")
    private Integer status;
    @ApiModelProperty(value = "药房id")
    private String pharmacyId;
    @TableField(fill= FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    public void copy(OtherCharge source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
